<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CANopenNode: Epoll interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CANopenNode
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__CO__epoll__interface.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Epoll interface<div class="ingroups"><a class="el" href="group__CO__socketCAN.html">socketCAN</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:CO__epoll__interface_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="CO__epoll__interface_8h.html">CO_epoll_interface.h</a></td></tr>
<tr class="memdesc:CO__epoll__interface_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper functions for Linux epoll interface to CANopenNode. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Object for epoll, timer and event API.  <a href="structCO__epoll__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Object for gateway.  <a href="structCO__epoll__gtw__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gad5a4218d5775fd7cda81a8015e1ee6f0"><td class="memItemLeft" align="right" valign="top"><a id="gad5a4218d5775fd7cda81a8015e1ee6f0"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#gad5a4218d5775fd7cda81a8015e1ee6f0">CO_commandInterface_t</a> </td></tr>
<tr class="memdesc:gad5a4218d5775fd7cda81a8015e1ee6f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Command interface type for gateway-ascii. <br /></td></tr>
<tr class="separator:gad5a4218d5775fd7cda81a8015e1ee6f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9bb687bf26f711ce0573581984b79443"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga9bb687bf26f711ce0573581984b79443">CO_epoll_create</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep, <a class="el" href="group__CO__dataTypes.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> timerInterval_us)</td></tr>
<tr class="memdesc:ga9bb687bf26f711ce0573581984b79443"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create Linux epoll, timerfd and eventfd.  <a href="group__CO__epoll__interface.html#ga9bb687bf26f711ce0573581984b79443">More...</a><br /></td></tr>
<tr class="separator:ga9bb687bf26f711ce0573581984b79443"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72c3ebdede1207e55e0915128f5a2c6a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga72c3ebdede1207e55e0915128f5a2c6a">CO_epoll_close</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep)</td></tr>
<tr class="memdesc:ga72c3ebdede1207e55e0915128f5a2c6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close epoll, timerfd and eventfd.  <a href="group__CO__epoll__interface.html#ga72c3ebdede1207e55e0915128f5a2c6a">More...</a><br /></td></tr>
<tr class="separator:ga72c3ebdede1207e55e0915128f5a2c6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5cfd1df62494cf9d9e85dbb9fe981a57"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep)</td></tr>
<tr class="memdesc:ga5cfd1df62494cf9d9e85dbb9fe981a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for an epoll event.  <a href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">More...</a><br /></td></tr>
<tr class="separator:ga5cfd1df62494cf9d9e85dbb9fe981a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2aef637d4f2f818a7d95a7bfac251132"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga2aef637d4f2f818a7d95a7bfac251132">CO_epoll_processLast</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep)</td></tr>
<tr class="memdesc:ga2aef637d4f2f818a7d95a7bfac251132"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closing function for an epoll event.  <a href="group__CO__epoll__interface.html#ga2aef637d4f2f818a7d95a7bfac251132">More...</a><br /></td></tr>
<tr class="separator:ga2aef637d4f2f818a7d95a7bfac251132"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3668c8b600022ffecdd3c2fa643b5e7d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga3668c8b600022ffecdd3c2fa643b5e7d">CO_epoll_initCANopenMain</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep, <a class="el" href="structCO__t.html">CO_t</a> *co)</td></tr>
<tr class="memdesc:ga3668c8b600022ffecdd3c2fa643b5e7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of functions in CANopen reset-communication section.  <a href="group__CO__epoll__interface.html#ga3668c8b600022ffecdd3c2fa643b5e7d">More...</a><br /></td></tr>
<tr class="separator:ga3668c8b600022ffecdd3c2fa643b5e7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad79d73fbac0e816f81f75507bd164515"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#gad79d73fbac0e816f81f75507bd164515">CO_epoll_processMain</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep, <a class="el" href="structCO__t.html">CO_t</a> *co, <a class="el" href="group__CO__dataTypes.html#ga449976458a084f880dc8e3d29e7eb6f5">bool_t</a> enableGateway, <a class="el" href="group__CO__NMT__Heartbeat.html#gaf42f056a571b8e17a2d74428d1a49674">CO_NMT_reset_cmd_t</a> *reset)</td></tr>
<tr class="memdesc:gad79d73fbac0e816f81f75507bd164515"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process CANopen mainline functions.  <a href="group__CO__epoll__interface.html#gad79d73fbac0e816f81f75507bd164515">More...</a><br /></td></tr>
<tr class="separator:gad79d73fbac0e816f81f75507bd164515"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ed67073bc96e575bec6fceb627b1245"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga6ed67073bc96e575bec6fceb627b1245">CO_epoll_processRT</a> (<a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep, <a class="el" href="structCO__t.html">CO_t</a> *co, <a class="el" href="group__CO__dataTypes.html#ga449976458a084f880dc8e3d29e7eb6f5">bool_t</a> realtime)</td></tr>
<tr class="memdesc:ga6ed67073bc96e575bec6fceb627b1245"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process CAN receive and realtime functions.  <a href="group__CO__epoll__interface.html#ga6ed67073bc96e575bec6fceb627b1245">More...</a><br /></td></tr>
<tr class="separator:ga6ed67073bc96e575bec6fceb627b1245"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7165df8b37ca1ed59476773fa075470c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga7165df8b37ca1ed59476773fa075470c">CO_epoll_createGtw</a> (<a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *epGtw, int epoll_fd, <a class="el" href="group__CO__dataTypes.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> commandInterface, <a class="el" href="group__CO__dataTypes.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> socketTimeout_ms, char *localSocketPath)</td></tr>
<tr class="memdesc:ga7165df8b37ca1ed59476773fa075470c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create socket for gateway-ascii command interface and add it to epoll.  <a href="group__CO__epoll__interface.html#ga7165df8b37ca1ed59476773fa075470c">More...</a><br /></td></tr>
<tr class="separator:ga7165df8b37ca1ed59476773fa075470c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab2f3f7bb7d885799c462e95a45563b69"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#gab2f3f7bb7d885799c462e95a45563b69">CO_epoll_closeGtw</a> (<a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *epGtw)</td></tr>
<tr class="memdesc:gab2f3f7bb7d885799c462e95a45563b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close gateway-ascii sockets.  <a href="group__CO__epoll__interface.html#gab2f3f7bb7d885799c462e95a45563b69">More...</a><br /></td></tr>
<tr class="separator:gab2f3f7bb7d885799c462e95a45563b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07eaf2c954bb09b6420acee62ff207c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga07eaf2c954bb09b6420acee62ff207c3">CO_epoll_initCANopenGtw</a> (<a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *epGtw, <a class="el" href="structCO__t.html">CO_t</a> *co)</td></tr>
<tr class="memdesc:ga07eaf2c954bb09b6420acee62ff207c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of gateway functions in CANopen reset-communication section.  <a href="group__CO__epoll__interface.html#ga07eaf2c954bb09b6420acee62ff207c3">More...</a><br /></td></tr>
<tr class="separator:ga07eaf2c954bb09b6420acee62ff207c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97aa0bc09684b0ed78b708198e663407"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CO__epoll__interface.html#ga97aa0bc09684b0ed78b708198e663407">CO_epoll_processGtw</a> (<a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *epGtw, <a class="el" href="structCO__t.html">CO_t</a> *co, <a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *ep)</td></tr>
<tr class="memdesc:ga97aa0bc09684b0ed78b708198e663407"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process CANopen gateway functions.  <a href="group__CO__epoll__interface.html#ga97aa0bc09684b0ed78b708198e663407">More...</a><br /></td></tr>
<tr class="separator:ga97aa0bc09684b0ed78b708198e663407"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Linux epoll interface to CANopenNode.</p>
<p>The Linux epoll API performs a monitoring multiple file descriptors to see if I/O is possible on any of them.</p>
<p>CANopenNode uses epoll interface to provide an event based mechanism. Epoll waits for multiple different events, such as: interval timer event, notification event, CAN receive event or socket based event for gateway. CANopenNode non-blocking functions are processed after each event.</p>
<p>CANopenNode itself offers functionality for calculation of time, when next interval timer event should trigger the processing. It can also trigger notification events in case of multi-thread operation. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga9bb687bf26f711ce0573581984b79443"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9bb687bf26f711ce0573581984b79443">&#9670;&nbsp;</a></span>CO_epoll_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a> CO_epoll_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__dataTypes.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a>&#160;</td>
          <td class="paramname"><em>timerInterval_us</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create Linux epoll, timerfd and eventfd. </p>
<p>Create and configure multiple Linux notification facilities, which trigger execution of the task. Epoll blocks and monitors multiple file descriptors, timerfd triggers in constant timer intervals and eventfd triggers on external signal.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>This object </td></tr>
    <tr><td class="paramname">timerInterval_us</td><td>Timer interval in microseconds</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a> CO_ERROR_NO, CO_ERROR_ILLEGAL_ARGUMENT or CO_ERROR_SYSCALL. </dd></dl>

</div>
</div>
<a id="ga72c3ebdede1207e55e0915128f5a2c6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72c3ebdede1207e55e0915128f5a2c6a">&#9670;&nbsp;</a></span>CO_epoll_close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close epoll, timerfd and eventfd. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>This object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga5cfd1df62494cf9d9e85dbb9fe981a57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5cfd1df62494cf9d9e85dbb9fe981a57">&#9670;&nbsp;</a></span>CO_epoll_wait()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_wait </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for an epoll event. </p>
<p>This function blocks until event registered on epoll: timerfd, eventfd, or application specified event. Function also calculates timeDifference_us since last call and prepares timerNext_us.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>This object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2aef637d4f2f818a7d95a7bfac251132"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2aef637d4f2f818a7d95a7bfac251132">&#9670;&nbsp;</a></span>CO_epoll_processLast()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_processLast </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Closing function for an epoll event. </p>
<p>This function must be called after <a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait()</a>. Between them should be application specified processing functions, which can check for own events and do own processing. Application may also lower timerNext_us variable. If lowered, then interval timer will be reconfigured and <a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait()</a> will be triggered earlier.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>This object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3668c8b600022ffecdd3c2fa643b5e7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3668c8b600022ffecdd3c2fa643b5e7d">&#9670;&nbsp;</a></span>CO_epoll_initCANopenMain()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_initCANopenMain </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__t.html">CO_t</a> *&#160;</td>
          <td class="paramname"><em>co</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialization of functions in CANopen reset-communication section. </p>
<p>Configure callbacks for CANopen objects.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>This object </td></tr>
    <tr><td class="paramname">co</td><td>CANopen object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gad79d73fbac0e816f81f75507bd164515"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad79d73fbac0e816f81f75507bd164515">&#9670;&nbsp;</a></span>CO_epoll_processMain()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_processMain </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__t.html">CO_t</a> *&#160;</td>
          <td class="paramname"><em>co</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__dataTypes.html#ga449976458a084f880dc8e3d29e7eb6f5">bool_t</a>&#160;</td>
          <td class="paramname"><em>enableGateway</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__NMT__Heartbeat.html#gaf42f056a571b8e17a2d74428d1a49674">CO_NMT_reset_cmd_t</a> *&#160;</td>
          <td class="paramname"><em>reset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process CANopen mainline functions. </p>
<p>This function calls <a class="el" href="group__CO__CANopen.html#ga895d7fad40b60aacdac3cb0615729b5e">CO_process()</a>. It is non-blocking and should execute cyclically. It should be between <a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait()</a> and <a class="el" href="group__CO__epoll__interface.html#ga2aef637d4f2f818a7d95a7bfac251132">CO_epoll_processLast()</a> functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">ep</td><td>This object </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">co</td><td>CANopen object </td></tr>
    <tr><td class="paramdir"></td><td class="paramname">enableGateway</td><td>If true, gateway to external world will be enabled. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">reset</td><td>Return from <a class="el" href="group__CO__CANopen.html#ga895d7fad40b60aacdac3cb0615729b5e">CO_process()</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6ed67073bc96e575bec6fceb627b1245"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ed67073bc96e575bec6fceb627b1245">&#9670;&nbsp;</a></span>CO_epoll_processRT()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_processRT </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__t.html">CO_t</a> *&#160;</td>
          <td class="paramname"><em>co</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__dataTypes.html#ga449976458a084f880dc8e3d29e7eb6f5">bool_t</a>&#160;</td>
          <td class="paramname"><em>realtime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process CAN receive and realtime functions. </p>
<p>This function checks epoll for CAN receive event and processes CANopen realtime functions: <a class="el" href="group__CO__CANopen.html#gaad5c15c3ca475912661f512d37413b12">CO_process_SYNC()</a>, <a class="el" href="group__CO__CANopen.html#ga4318848921c35e8bb5a7d97dca5668a0">CO_process_RPDO()</a> and <a class="el" href="group__CO__CANopen.html#ga8c62a2afd2762d99e9c9be13a3d9a7a8">CO_process_TPDO()</a>. It is non-blocking and should execute cyclically. It should be between <a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait()</a> and <a class="el" href="group__CO__epoll__interface.html#ga2aef637d4f2f818a7d95a7bfac251132">CO_epoll_processLast()</a> functions.</p>
<p>Function can be used in the mainline thread or in own realtime thread.</p>
<p>Processing of CANopen realtime functions is protected with <a class="el" href="group__CO__critical__sections.html#ga3850830931ced2bd3d7e15821572bbcc">CO_LOCK_OD</a>. Also Node-Id must be configured and CANmodule must be in CANnormal for processing.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ep</td><td>Pointer to <a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> object. </td></tr>
    <tr><td class="paramname">co</td><td>CANopen object </td></tr>
    <tr><td class="paramname">realtime</td><td>Set to true, if function is called from the own realtime thread, and is executed at short constant interval. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga7165df8b37ca1ed59476773fa075470c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7165df8b37ca1ed59476773fa075470c">&#9670;&nbsp;</a></span>CO_epoll_createGtw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a> CO_epoll_createGtw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *&#160;</td>
          <td class="paramname"><em>epGtw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>epoll_fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__dataTypes.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a>&#160;</td>
          <td class="paramname"><em>commandInterface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CO__dataTypes.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a>&#160;</td>
          <td class="paramname"><em>socketTimeout_ms</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>localSocketPath</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create socket for gateway-ascii command interface and add it to epoll. </p>
<p>Depending on arguments function configures stdio interface or local socket or IP socket.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">epGtw</td><td>This object </td></tr>
    <tr><td class="paramname">epoll_fd</td><td>Already configured epoll file descriptor </td></tr>
    <tr><td class="paramname">commandInterface</td><td>Command interface type from CO_commandInterface_t </td></tr>
    <tr><td class="paramname">socketTimeout_ms</td><td>Timeout for established socket connection in [ms] </td></tr>
    <tr><td class="paramname">localSocketPath</td><td>File path, if commandInterface is local socket</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__CO__driver.html#ga1cb2d3466eb0c6d267f3b5ff1a0d9532">CO_ReturnError_t</a> CO_ERROR_NO, CO_ERROR_ILLEGAL_ARGUMENT or CO_ERROR_SYSCALL. </dd></dl>

</div>
</div>
<a id="gab2f3f7bb7d885799c462e95a45563b69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab2f3f7bb7d885799c462e95a45563b69">&#9670;&nbsp;</a></span>CO_epoll_closeGtw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_closeGtw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *&#160;</td>
          <td class="paramname"><em>epGtw</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close gateway-ascii sockets. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">epGtw</td><td>This object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga07eaf2c954bb09b6420acee62ff207c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07eaf2c954bb09b6420acee62ff207c3">&#9670;&nbsp;</a></span>CO_epoll_initCANopenGtw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_initCANopenGtw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *&#160;</td>
          <td class="paramname"><em>epGtw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__t.html">CO_t</a> *&#160;</td>
          <td class="paramname"><em>co</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialization of gateway functions in CANopen reset-communication section. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">epGtw</td><td>This object </td></tr>
    <tr><td class="paramname">co</td><td>CANopen object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga97aa0bc09684b0ed78b708198e663407"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga97aa0bc09684b0ed78b708198e663407">&#9670;&nbsp;</a></span>CO_epoll_processGtw()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CO_epoll_processGtw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structCO__epoll__gtw__t.html">CO_epoll_gtw_t</a> *&#160;</td>
          <td class="paramname"><em>epGtw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__t.html">CO_t</a> *&#160;</td>
          <td class="paramname"><em>co</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process CANopen gateway functions. </p>
<p>This function checks for epoll events and verifies socket connection timeout. It is non-blocking and should execute cyclically. It should be between <a class="el" href="group__CO__epoll__interface.html#ga5cfd1df62494cf9d9e85dbb9fe981a57">CO_epoll_wait()</a> and <a class="el" href="group__CO__epoll__interface.html#ga2aef637d4f2f818a7d95a7bfac251132">CO_epoll_processLast()</a> functions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">epGtw</td><td>This object </td></tr>
    <tr><td class="paramname">co</td><td>CANopen object </td></tr>
    <tr><td class="paramname">ep</td><td>Pointer to <a class="el" href="structCO__epoll__t.html">CO_epoll_t</a> object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Thu Dec 24 2020 14:30:50 for CANopenNode by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
